import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class main {
    public static void main(String[] args) {

        ChromeOptions options = new ChromeOptions();
        // 允许所有请求
        options.addArguments("--remote-allow-origins=*");
        WebDriver webDriver = new ChromeDriver(options);
        // 打开百度首页
        webDriver.get("https://baidu.com");

//        // 定位百度首页输入框 findElement
//        WebElement element =  webDriver.findElement(By.cssSelector(".s_ipt"));
//        // 输入软件测试
//        element.sendKeys("软件测试");
        // xpath
        WebElement element1 = webDriver.findElement(By.xpath("//*[@id=\"kw\"]"));
        element1.sendKeys("牛逼");
    }
}
